    /// <summary>
    /// {{description}}{{^description}}{{classname}}{{/description}}
    /// </summary>
    {{#vendorExtensions.x-cls-compliant}}
    [CLSCompliant({{{vendorExtensions.x-cls-compliant}}})]
    {{/vendorExtensions.x-cls-compliant}}
    {{#vendorExtensions.x-com-visible}}
    [ComVisible({{{vendorExtensions.x-com-visible}}})]
    {{/vendorExtensions.x-com-visible}}
    [DataContract(Name = "{{{name}}}")]
    {{^useUnityWebRequest}}
    {{#discriminator}}
    [JsonConverter(typeof(JsonSubtypes), "{{{discriminatorName}}}")]
    {{#mappedModels}}
    [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")]
    {{/mappedModels}}
    {{/discriminator}}
    {{/useUnityWebRequest}}
    {{>visibility}} partial class {{classname}}{{#lambda.firstDot}}{{#parent}} : .{{/parent}}{{#validatable}} : .{{/validatable}}{{#equatable}} : .{{/equatable}}{{/lambda.firstDot}}{{#lambda.joinWithComma}}{{#parent}}{{{.}}}  {{/parent}}{{#equatable}}IEquatable<{{classname}}>  {{/equatable}}{{#validatable}}IValidatableObject  {{/validatable}}{{/lambda.joinWithComma}}
    {
        {{#vars}}
        {{#items.isEnum}}
        {{#items}}
        {{^complexType}}
{{>modelInnerEnum}}
        {{/complexType}}
        {{/items}}
        {{/items.isEnum}}
        {{#isEnum}}
        {{^complexType}}
{{>modelInnerEnum}}
        {{/complexType}}
        {{/isEnum}}
        {{#isEnum}}

        /// <summary>
        /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
        /// </summary>
        {{#description}}
        /// <value>{{.}}</value>
        {{/description}}
        {{#example}}
        /// <example>{{.}}</example>
        {{/example}}
        {{^conditionalSerialization}}
        [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})]
        {{#deprecated}}
        [Obsolete]
        {{/deprecated}}
        public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; }
        {{#isReadOnly}}

        /// <summary>
        /// Returns false as {{name}} should not be serialized given that it's read-only.
        /// </summary>
        /// <returns>false (boolean)</returns>
        public bool ShouldSerialize{{name}}()
        {
            return false;
        }
        {{/isReadOnly}}
        {{/conditionalSerialization}}
        {{#conditionalSerialization}}
        {{#isReadOnly}}
        [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})]
        {{#deprecated}}
        [Obsolete]
        {{/deprecated}}
        public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; }


        /// <summary>
        /// Returns false as {{name}} should not be serialized given that it's read-only.
        /// </summary>
        /// <returns>false (boolean)</returns>
        public bool ShouldSerialize{{name}}()
        {
            return false;
        }
        {{/isReadOnly}}

        {{^isReadOnly}}
        [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})]
        {{#deprecated}}
        [Obsolete]
        {{/deprecated}}
        public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}}
        {
            get{ return _{{name}};}
            set
            {
                _{{name}} = value;
                _flag{{name}} = true;
            }
        }
        private {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} _{{name}};
        private bool _flag{{name}};

        /// <summary>
        /// Returns false as {{name}} should not be serialized given that it's read-only.
        /// </summary>
        /// <returns>false (boolean)</returns>
        public bool ShouldSerialize{{name}}()
        {
            return _flag{{name}};
        }
        {{/isReadOnly}}
        {{/conditionalSerialization}}
        {{/isEnum}}
        {{/vars}}
    {{#hasRequired}}
    {{^hasOnlyReadOnly}}
        /// <summary>
        /// Initializes a new instance of the <see cref="{{classname}}" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        {{^isAdditionalPropertiesTrue}}
        protected {{classname}}() { }
        {{/isAdditionalPropertiesTrue}}
        {{#isAdditionalPropertiesTrue}}
        protected {{classname}}()
        {
            this.AdditionalProperties = new Dictionary<string, object>();
        }
        {{/isAdditionalPropertiesTrue}}
    {{/hasOnlyReadOnly}}
    {{/hasRequired}}
        /// <summary>
        /// Initializes a new instance of the <see cref="{{classname}}" /> class.
        /// </summary>
        {{#readWriteVars}}
        /// <param name="{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}">{{description}}{{^description}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}.</param>
        {{/readWriteVars}}
    {{#hasOnlyReadOnly}}
        [JsonConstructorAttribute]
    {{/hasOnlyReadOnly}}
        public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{#defaultValue}}{{^isDateTime}}{{#isString}}{{^isEnum}}@{{/isEnum}}{{/isString}}{{{defaultValue}}}{{/isDateTime}}{{#isDateTime}}default({{{datatypeWithEnum}}}){{/isDateTime}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}}
        {
            {{#vars}}
            {{^isInherited}}
            {{^isReadOnly}}
            {{#required}}
            {{^conditionalSerialization}}
            {{^vendorExtensions.x-csharp-value-type}}
            // to ensure "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" is required (not null)
            if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null)
            {
                throw new ArgumentNullException("{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} is a required property for {{classname}} and cannot be null");
            }
            this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}};
            {{/vendorExtensions.x-csharp-value-type}}
            {{#vendorExtensions.x-csharp-value-type}}
            this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}};
            {{/vendorExtensions.x-csharp-value-type}}
            {{/conditionalSerialization}}
            {{#conditionalSerialization}}
            {{^vendorExtensions.x-csharp-value-type}}
            // to ensure "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" is required (not null)
            if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null)
            {
                throw new ArgumentNullException("{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} is a required property for {{classname}} and cannot be null");
            }
            this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}};
            {{/vendorExtensions.x-csharp-value-type}}
            {{#vendorExtensions.x-csharp-value-type}}
            this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}};
            {{/vendorExtensions.x-csharp-value-type}}
            {{/conditionalSerialization}}
            {{/required}}
            {{/isReadOnly}}
            {{/isInherited}}
            {{/vars}}
            {{#vars}}
            {{^isInherited}}
            {{^isReadOnly}}
            {{^required}}
            {{#defaultValue}}
            {{^conditionalSerialization}}
            {{^vendorExtensions.x-csharp-value-type}}
            // use default value if no "{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}" provided
            this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} ?? {{#isString}}@{{/isString}}{{{defaultValue}}};
            {{/vendorExtensions.x-csharp-value-type}}
            {{#vendorExtensions.x-csharp-value-type}}
            this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}};
            {{/vendorExtensions.x-csharp-value-type}}
            {{/conditionalSerialization}}
            {{/defaultValue}}
            {{^defaultValue}}
            {{^conditionalSerialization}}
            this.{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}};
            {{/conditionalSerialization}}
            {{#conditionalSerialization}}
            this._{{name}} = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}};
            if (this.{{name}} != null)
            {
                this._flag{{name}} = true;
            }
            {{/conditionalSerialization}}
            {{/defaultValue}}
            {{/required}}
            {{/isReadOnly}}
            {{/isInherited}}
            {{/vars}}
            {{#isAdditionalPropertiesTrue}}
            this.AdditionalProperties = new Dictionary<string, object>();
            {{/isAdditionalPropertiesTrue}}
        }

        {{#vars}}
        {{^isInherited}}
        {{^isEnum}}
        /// <summary>
        /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
        /// </summary>{{#description}}
        /// <value>{{.}}</value>{{/description}}
        {{#example}}
        /// <example>{{.}}</example>
        {{/example}}
        {{^conditionalSerialization}}
        [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})]
        {{#isDate}}
        {{^supportsDateOnly}}
        [JsonConverter(typeof(OpenAPIDateConverter))]
        {{/supportsDateOnly}}
        {{/isDate}}
        {{#deprecated}}
        [Obsolete]
        {{/deprecated}}
        public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }

        {{#isReadOnly}}
        /// <summary>
        /// Returns false as {{name}} should not be serialized given that it's read-only.
        /// </summary>
        /// <returns>false (boolean)</returns>
        public bool ShouldSerialize{{name}}()
        {
            return false;
        }
        {{/isReadOnly}}
        {{/conditionalSerialization}}
        {{#conditionalSerialization}}
        {{#isReadOnly}}
        [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})]
        {{#isDate}}
        [JsonConverter(typeof(OpenAPIDateConverter))]
        {{/isDate}}
        {{#deprecated}}
        [Obsolete]
        {{/deprecated}}
        public {{{dataType}}} {{name}} { get; private set; }

        /// <summary>
        /// Returns false as {{name}} should not be serialized given that it's read-only.
        /// </summary>
        /// <returns>false (boolean)</returns>
        public bool ShouldSerialize{{name}}()
        {
            return false;
        }
        {{/isReadOnly}}
        {{^isReadOnly}}
        {{#isDate}}
        [JsonConverter(typeof(OpenAPIDateConverter))]
        {{/isDate}}
        [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#required}}true{{/required}}{{^required}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/required}}{{/vendorExtensions.x-emit-default-value}})]
        {{#deprecated}}
        [Obsolete]
        {{/deprecated}}
        public {{{dataType}}} {{name}}
        {
            get{ return _{{name}};}
            set
            {
                _{{name}} = value;
                _flag{{name}} = true;
            }
        }
        private {{{dataType}}} _{{name}};
        private bool _flag{{name}};

        /// <summary>
        /// Returns false as {{name}} should not be serialized given that it's read-only.
        /// </summary>
        /// <returns>false (boolean)</returns>
        public bool ShouldSerialize{{name}}()
        {
            return _flag{{name}};
        }
        {{/isReadOnly}}
        {{/conditionalSerialization}}
        {{/isEnum}}
        {{/isInherited}}
        {{/vars}}
        {{#isAdditionalPropertiesTrue}}
        /// <summary>
        /// Gets or Sets additional properties
        /// </summary>
        [JsonExtensionData]
        public IDictionary<string, object> AdditionalProperties { get; set; }

        {{/isAdditionalPropertiesTrue}}
        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class {{classname}} {\n");
            {{#parent}}
            sb.Append("  ").Append(base.ToString().Replace("\n", "\n  ")).Append("\n");
            {{/parent}}
            {{#vars}}
            sb.Append("  {{name}}: ").Append({{name}}).Append("\n");
            {{/vars}}
            {{#isAdditionalPropertiesTrue}}
            sb.Append("  AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
            {{/isAdditionalPropertiesTrue}}
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public {{#parent}}{{^isArray}}{{^isMap}}override {{/isMap}}{{/isArray}}{{/parent}}{{^parent}}virtual {{/parent}}string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
        }
        {{#equatable}}

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="input">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object input)
        {
            {{#useCompareNetObjects}}
            return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual;
            {{/useCompareNetObjects}}
            {{^useCompareNetObjects}}
            return this.Equals(input as {{classname}});
            {{/useCompareNetObjects}}
        }

        /// <summary>
        /// Returns true if {{classname}} instances are equal
        /// </summary>
        /// <param name="input">Instance of {{classname}} to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals({{classname}} input)
        {
            {{#useCompareNetObjects}}
            return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
            {{/useCompareNetObjects}}
            {{^useCompareNetObjects}}
            if (input == null)
            {
                return false;
            }
            return {{#vars}}{{#parent}}base.Equals(input) && {{/parent}}{{^isContainer}}
                (
                    this.{{name}} == input.{{name}} ||
                    {{^vendorExtensions.x-is-value-type}}
                    (this.{{name}} != null &&
                    this.{{name}}.Equals(input.{{name}}))
                    {{/vendorExtensions.x-is-value-type}}
                    {{#vendorExtensions.x-is-value-type}}
                    this.{{name}}.Equals(input.{{name}})
                    {{/vendorExtensions.x-is-value-type}}
                ){{^-last}} && {{/-last}}{{/isContainer}}{{#isContainer}}
                (
                    this.{{name}} == input.{{name}} ||
                    {{^vendorExtensions.x-is-value-type}}this.{{name}} != null &&
                    input.{{name}} != null &&
                    {{/vendorExtensions.x-is-value-type}}this.{{name}}.SequenceEqual(input.{{name}})
                ){{^-last}} && {{/-last}}{{/isContainer}}{{/vars}}{{^vars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/vars}}{{^isAdditionalPropertiesTrue}};{{/isAdditionalPropertiesTrue}}
                {{#isAdditionalPropertiesTrue}}
                && (this.AdditionalProperties.Count == input.AdditionalProperties.Count && !this.AdditionalProperties.Except(input.AdditionalProperties).Any());
                {{/isAdditionalPropertiesTrue}}
            {{/useCompareNetObjects}}
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                {{#parent}}
                int hashCode = base.GetHashCode();
                {{/parent}}
                {{^parent}}
                int hashCode = 41;
                {{/parent}}
                {{#vars}}
                {{^vendorExtensions.x-is-value-type}}
                if (this.{{name}} != null)
                {
                    hashCode = (hashCode * 59) + this.{{name}}.GetHashCode();
                }
                {{/vendorExtensions.x-is-value-type}}
                {{#vendorExtensions.x-is-value-type}}
                hashCode = (hashCode * 59) + this.{{name}}.GetHashCode();
                {{/vendorExtensions.x-is-value-type}}
                {{/vars}}
                {{#isAdditionalPropertiesTrue}}
                if (this.AdditionalProperties != null)
                {
                    hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
                }
                {{/isAdditionalPropertiesTrue}}
                return hashCode;
            }
        }
        {{/equatable}}

{{#validatable}}
{{>validatable}}
{{/validatable}}
    }
